You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Regress Class > Regress Methods > ANOVA1 Method > Regress.ANOVA1 Method ([In] TVec, [In] TVecInt, out double, double)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Regress.ANOVA1 Method ([In] TVec, [In] TVecInt, out double, double)

Perform the one-way analysis of variance where Data vector (one variable) is indexed by a second grouping GroupIndex vector variable.

Syntax
C#
Visual Basic
public static TANOVA1Result ANOVA1([In] TVec Data, [In] TVecInt GroupIndex, out double p, double Alpha);
Parameters 
Description 
[In] TVec Data 
Data vector of single variable. 
[In] TVecInt GroupIndex 
Stores group indexes. 
out double p 
Returns the significance probability of null hypothesis that two means are equal. If p is less than desired significance alpha then the result suggests the null hypothesis (two means are equal) can be rejected. 
double Alpha 
Desired significance level. 

The following example will perform ANOVA on single variable with three groups (0,1,2 - stored in GroupIndex vector).

using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector Data = new Vector(0); Vector GroupIndex = new Vector(0); double signprob; TANOVA1Result ar; Data.SetIt(false, new double[] {1,2,3,4,5,6,7,8,9,10,11,12}); GroupIndex.SetIt(false, new double[] {0,0,0,0,1,1,1,1,2,2,2,2}); ar = Regress.ANOVA1(Data,GroupIndex,out signprob,0.05); // ANOVARes = (SS1:128; SS2:15; SSTotal:143; // Deg1:2; Deg2:9; DegTotal:11; MS1:64; // MS2:1.6666666667; FDist:38.4; FCrit:4.2564947291) // signprob = 3.9210149408e-05 } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!